import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'
import layoutComponent from '@/layout/index.vue';

const routers: RouteRecordRaw[] = []

const LayoutRouter: RouteRecordRaw = {
  path: '/',
  name: 'Layout',
  component: layoutComponent
}

const LoginRouter: RouteRecordRaw = {
  path: '/login',
  name: 'Login',
  redirect: '/login/page',
  component: layoutComponent,
  children: [
    {
      path: 'page',
      name: 'Login_page',
      component: () => import('@/views/login/index.vue')
    }
  ]
}

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [LayoutRouter, LoginRouter, ...routers]
})

export default router
